/* $Header: seq_ui.h,v 2.2 01/10/02 10:30:39 przybyls Exp $ */

/***********************************************************************/
/* INCLUDE FILE NAME:  seq_ui.h                                        */
/* ==================                                                  */
/*                                                                     */
/* Author:  Tom Przybylski                                             */
/*                                                                     */
/* COMMENT:  Fn protos and stuff for user interface accessing the      */
/*           sequence data structures.                                 */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef SEQUI_H
#define SEQUI_H

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/*****************************/
/*   MACROS                  */
/*****************************/


/*****************************/
/*   TYPEDEFS                */
/*****************************/


/****************************/
/*   EXTERNAL VARIABLES     */
/****************************/


/*****************************/
/*   FUNCTION PROTOTYPES     */
/*****************************/

UI_ERR     CheckSeqMethodNo (INT32 meth);
UI_ERR     CheckSeqType (SEQ_TYPE type);
UI_ERR     CheckSeqRepeat (INT32 repeat);
UI_ERR     CheckNumInj (INT32 num, SEQ_TYPE type);
UI_ERR     CheckStoredSeqRange (INT32 num, SEQ_TYPE type);

void       RewindSeqFmt (void);
INT16      ReadSeqFmt (BIT8 *string);

UI_ERR     SetSeqMethodNo (INT32 meth, U_INT8 seq);
UI_ERR     SetPostSeqMethodNo (INT32 meth);
UI_ERR     SetSeqType (SEQ_TYPE type, U_INT8 seq);
UI_ERR     SetNumInj (INT32 num, U_INT8 seq, POSITION posn);
UI_ERR     TurnSeqMethodOn (U_INT8 seq);
UI_ERR     TurnSeqMethodOff (U_INT8 seq);
UI_ERR     TurnSeqPriorityOn (void);
UI_ERR     TurnSeqPriorityOff (void);
UI_ERR     TurnRepeatSeqOn (void);
UI_ERR     TurnRepeatSeqOff (void);
UI_ERR     TurnOverlapSeqOn (void);
UI_ERR     TurnOverlapSeqOff (void);
UI_ERR     SetSeqRange (INT32 begin, INT32 end, U_INT8 seq, POSITION posn);
UI_ERR     SetSeqRepeat (INT32 repeat, U_INT8 seq);
UI_ERR     GetSeqStatus (void);      /* For INET */
UI_ERR     StepSequence (void);      /* For INET */

UI_ERR     SequenceExists (U_INT8 seq);
UI_ERR     LoadSequence (U_INT8 seq);
void       StoreSequence (U_INT8 seq);
void       DeleteSequence (U_INT8 seq);
DATETIME   GetSequenceDateTime (U_INT8 seq);

void       StopSequence (void);
void       AbortSequence (BIT8 stopals);
void       SeqStopSequence (void);
UI_ERR     StartSequence (void);
void       PauseSequence (void);
UI_ERR     ResumeSequence (void);
void       ResetSequence (void);
void       PushSequence  (void);
void       HaltAndBackupSequence (void);

BIT8       SequenceInProgress (void);
BIT8       SequencePaused (void);
BIT8       SequenceStopped (void);
BIT8       SequenceOff (void);
BIT8       NotInetSequence (void);

INT32      GetSeqMethodNo (U_INT8 seq);
INT32      GetPostSeqMethodNo (void);
ON_OFF     GetSeqMethodOnOff (U_INT8 seq);
ON_OFF     GetSeqPriorityOnOff (void);
ON_OFF     GetRepeatSeqOnOff (void);
ON_OFF     GetOverlapSeqOnOff (void);
SEQ_TYPE   GetSeqType (U_INT8 seq);
INT32      GetNumInj (U_INT8 seq, POSITION posn);
INT32      GetBeginRange (U_INT8 seq, POSITION posn);
INT32      GetEndRange (U_INT8 seq, POSITION posn);
INT32      GetSeqRepeat (U_INT8 seq);

INT32      GetCurrentSubseq (void);
SEQ_TYPE   GetCurrentType (void);
INT32      GetCurrentFrInjNum (void);
INT32      GetCurrentFrInjMax (void);
INT32      GetCurrentBkInjNum (void);
INT32      GetCurrentBkInjMax (void);
INT32      GetCurrentRepeatNum (void);
INT32      GetCurrentRepeatMax (void);
INT32      GetCurrentFrontSample (void);
INT32      GetCurrentBackSample (void);
INT32      GetFrontSample (void);
INT32      GetBackSample (void);

void       SetSampleNumbers (void);  /* used by Start Run */

BIT8       GsvInjInProgress (void);
UI_ERR     StartGsvInjection (U_INT8 valve1, U_INT8 valve2, U_INT8 nordy );
void       StopGsvInjection (void);
void       AbortGsvInjection (void);
GSV_INJ_STATE GetGsvInjectionState (void);

#endif
